function getBaseURL() {
		var url = location.href;  // entire url including querystring - also: window.location.href;
		var baseURL = url.substring(0, url.indexOf('/', 14));
	
	
		if (baseURL.indexOf('localhost') != -1 || baseURL.indexOf('127.0.0.1') != -1) {
			// Base Url for localhost
			var url = location.href;  // window.location.href;
			var pathname = location.pathname;  // window.location.pathname;
			var index1 = url.indexOf(pathname);
			var index2 = url.indexOf("/", index1 + 1);
			var baseLocalUrl = url.substr(0, index2);
	
			return baseLocalUrl + "/";
		}
		else {
			// Root Url for domain name
			return baseURL + "/";
		}
	
	}
	
var pathname = window.location.href;
		var matchPos1 = pathname.search('#');
		if(matchPos1 != -1){
				var check=pathname.substring(matchPos1+1);
				var checkindex = check.search('index.php');
				if(checkindex != -1)
					window.location.replace(getBaseURL()+check);
				else
					window.location.replace(getBaseURL());	
		}	